from datetime import datetime

from sqlalchemy import Text, Column, Float, Integer, String, DateTime
from config.database import Base


class PlantPlanter(Base):
    """
    种植主体信息表
    """

    __tablename__ = 'plant_planter'

    planter_id = Column(Integer, primary_key=True, autoincrement=True, comment='种植主体ID')
    year = Column(Integer, nullable=True, comment='数据年份')
    planter_name = Column(String(200), nullable=True, comment='主体名称')
    planter_type = Column(String(50), nullable=True, comment='主体类型')
    area_size_measured = Column(Float, nullable=True, comment='实际量地面积')
    county = Column(String(100), nullable=True, comment='所在县')
    village = Column(String(100), nullable=True, comment='所在村')
    area_size_service = Column(Float, nullable=True, comment='托管服务面积')
    measure_state = Column(Integer, nullable=True, comment='量地状态')
    sign_state = Column(Integer, nullable=True, comment='签约状态')
    is_rent = Column(Integer, nullable=True, comment='是否需要支付地租')
    principal = Column(Text, nullable=True, comment='种植主体负责人')
    area_size_facility = Column(Float, nullable=True, comment='签约设施种植面积（亩）')
    principal_mobile = Column(Text, nullable=True, comment='负责人联系电话')
    principal_idno = Column(Text, nullable=True, comment='负责人身份证号')
    is_seed = Column(Integer, nullable=True, comment='是否需要支付种苗款')
    seed_amount_estimated = Column(Float, nullable=True, comment='种苗预估数量')
    area_size_openair = Column(Float, nullable=True, comment='露地签约面积')
    taxer_no = Column(String(30), nullable=True, comment='纳税人识别号')
    bank_account_name = Column(Text, nullable=True, comment='银行开户名称')
    remark = Column(Text, nullable=True, comment='备注')
    area_size_policy = Column(Float, nullable=True, comment='村集体流转面积')
    plant_density_openair = Column(Integer, nullable=True, comment='露地种植密度')
    plant_density_facility = Column(Integer, nullable=True, comment='设施种植密度')
    bank_account = Column(String(255), nullable=True, comment='银行账号')
    bank_name = Column(String(255), nullable=True, comment='开户银行')
    area_count_facility = Column(Integer, nullable=True, comment='签约设施种植棚数')
    create_by = Column(String(64), default='', comment='创建者')
    create_time = Column(DateTime, comment='创建时间', default=datetime.now())
    update_by = Column(String(64), default='', comment='更新者')
    update_time = Column(DateTime, comment='更新时间', default=datetime.now())




